// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('@/components/common/login'),
    children: []
  },
  {
    path: '/logup',
    component: () => import('@/components/common/logup'),
    children: []
  },
  {
    path: '/forget',
    component: () => import('@/components/common/forget'),
    children: []
  },
  {
    path: '/teacher',
    component: () => import('@/components/teacher/index'),
    children: [
      { 
        path: '', component: () => import('@/components/common/hello') 
      },
      { 
        path: 'courseDisplay', component: () => import('@/components/teacher/courseDisplay.vue') 
      },
      { 
        path: 'courseManage', 
        component: () => import('@/components/teacher/courseManage.vue'),
        children: [
          { 
            path: 'courseInfoManage', component: () => import('@/components/teacherCourse/courseInfoManage.vue') 
          },
          { 
            path: 'courseStuManage', component: () => import('@/components/teacherCourse/courseStuManage.vue') 
          },
          {
            path: 'courseStuAddMulti', component: () => import('@/components/teacherCourse/courseStuAddMulti.vue') 
          },
          { 
            path: 'knowledgeUpload', component: () => import('@/components/teacherCourse/knowledgeUpload.vue') 
          },
          { 
            path: 'knowledgeGenerate', component: () => import('@/components/teacherCourse/knowledgeGenerate.vue') 
          },
          { 
            path: 'knowledgeNewQuesOrExam', component: () => import('@/components/teacherCourse/knowledgeNewQuesOrExam.vue') 
          },
          {
            path: 'knowledgeAddMultiQues', component: () => import('@/components/teacherCourse/knowledgeAddMultiQues.vue')
          },
          { 
            path: 'AIassistant', component: () => import('@/components/teacherCourse/AIassistantCourse.vue') 
          },
          { 
            path: 'examDisplay', component: () => import('@/components/teacherCourse/examDisplay.vue') 
          },
          { 
            path: 'examQuestionManage', component: () => import('@/components/teacherCourse/examQuestionManage.vue') 
          },
          { 
            path: 'examAddOneQuestion', component: () => import('@/components/teacherCourse/examAddOneQuestion.vue') 
          },
          { 
            path: 'courseInfoDetail', component: () => import('@/components/teacherCourse/courseInfoDetail.vue') 
          },  
          { 
            path: 'examSomeoneScore', component: () => import('@/components/teacherCourse/examSomeoneScore.vue') 
          },      
        ]
      },
      { 
        path: 'personalManage', component: () => import('@/components/teacher/personalManage.vue') 
      },
      { 
        path: 'messageBox', component: () => import('@/components/teacher/messageBox.vue') 
      },
      { 
        path: 'messageSend', component: () => import('@/components/teacher/messageSend.vue') 
      },
      { 
        path: 'AIassistant', component: () => import('@/components/teacher/AIassistant.vue') 
      },
      { 
        path: 'grade', component: () => import('@/components/charts/grade') 
      },
      { 
        path: 'scorePart', component: () => import('@/components/charts/scorePart') 
      },
      { 
        path: 'allStudentsGrade', component: () => import('@/components/teacher/allStudentsGrade') 
      },
      { 
        path: 'examDescription', component: () => import('@/components/teacher/examDescription') 
      },
      { 
        path: 'selectExam', component: () => import('@/components/teacher/selectExam') 
      },
      { 
        path: 'addExam', component: () => import('@/components/teacher/addExam') 
      },
      { 
        path: 'selectAnswer', component: () => import('@/components/teacher/selectAnswer') 
      },
      { 
        path: 'studentManage', component: () => import('@/components/teacher/studentManage') 
      },
      { 
        path: 'addStudent', component: () => import('@/components/teacher/addStudent') 
      },
      { 
        path: 'teacherManage', component: () => import('@/components/admin/teacherManage') 
      },
      { 
        path: 'addTeacher', component: () => import('@/components/admin/addTeacher') 
      },
    ]
  },
  {
    path: '/admin',
    component: () => import('@/components/admin/index'),
    children: [
      { 
        path: '', component: () => import('@/components/common/hello') 
      },
      { 
        path: 'grade', component: () => import('@/components/charts/grade') 
      },
      { 
        path: 'scorePart', component: () => import('@/components/charts/scorePart') 
      },
      { 
        path: 'allStudentsGrade', component: () => import('@/components/teacher/allStudentsGrade') 
      },
      { 
        path: 'examDescription', component: () => import('@/components/teacher/examDescription') 
      },
      { 
        path: 'selectExam', component: () => import('@/components/teacher/selectExam') 
      },
      { 
        path: 'addExam', component: () => import('@/components/teacher/addExam') 
      },
      { 
        path: 'selectAnswer', component: () => import('@/components/teacher/selectAnswer') 
      },
      { 
        path: 'studentManage', component: () => import('@/components/teacher/studentManage') 
      },
      { 
        path: 'addStudent', component: () => import('@/components/teacher/addStudent') 
      },
      { 
        path: 'teacherManage', component: () => import('@/components/admin/teacherManage') 
      },
      { 
        path: 'addTeacher', component: () => import('@/components/admin/addTeacher') 
      },
    ]
  },
  ,
  {
    path: '/student',
    component: () => import('@/components/student/index'),
    children: [
      { 
        path: '', component: () => import('@/components/student/hello') 
      },
      {
        path: 'learn_info/:courseId',
        component: () => import('@/components/student/learn_info.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'learn_info',
            component: () => import('@/components/student/learn_info.vue')
          }
        ]
      },
      {
        path: 'learn/:courseId',
        component: () => import('@/components/student/learn.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'learn',
            component: () => import('@/components/student/learn.vue')
          }
        ]
      },
      {
        path: 'AIhelper/:courseId',
        component: () => import('@/components/student/AIhelper.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'AIhelper',
            component: () => import('@/components/student/AIhelper.vue')
          }
        ]
      },
      /*{
        path: 'learn_speed/:courseId',
        component: () => import('@/components/student/learn_class.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'learn_speed',
            component: () => import('@/components/student/learn_class.vue')
          }
        ]
      },*/
      {
        path: 'learn_document/:courseId',
        component: () => import('@/components/student/learn_document.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'learn_document',
            component: () => import('@/components/student/learn_document.vue')
          }
        ]
      },
      {
        path: 'examMsg/:name',
        component: () => import('@/components/student/examMsg.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'examMsg',
            component: () => import('@/components/student/examMsg.vue')
          }
        ]
      },
      {
        path: 'examMsg1/:name',
        component: () => import('@/components/student/examMsg1.vue'), // 即你刚刚写的这个页面
         children: [
          {
            path: 'examMsg1',
            component: () => import('@/components/student/examMsg1.vue')
          }
        ]
      },
      { 
        path: 'startExam', component: () => import('@/components/student/startExam') 
      },
      { 
        path: 'manager', component: () => import('@/components/student/manager') 
      },
      { 
        path: 'examMsg', component: () => import('@/components/student/examMsg') 
      },
      { 
        path: 'message', component: () => import('@/components/student/message') 
      },
      { 
        path: 'studentScore', component: () => import('@/components/student/answerScore') 
      },
      { 
        path: 'scoreTable', component: () => import('@/components/student/scoreTable') 
      },
      { 
        path: 'exam', component: () => import('@/components/student/exam') 
      },
      { 
        path: 'examBefore', component: () => import('@/components/student/examBefore') 
      },
      { 
        path: 'learn', component: () => import('@/components/student/learn') 
      },
      { 
        path: 'learn_document', component: () => import('@/components/student/learn_document') 
      },
      { 
        path: 'learn_info', component: () => import('@/components/student/learn_info') 
      },
      { 
        path: 'AIhelper', component: () => import('@/components/student/AIhelper') 
      },
      {
        path: '/answer', component: () => import('@/components/student/answer')
      },
      {
        path: '/analysis', component: () => import('@/components/student/analysis')
      },
      {
        path: '/answerSheet', component: () => import('@/components/student/answerSheet')
      }
    ]
  },
  {
    path: '/answer',
    component: () => import('@/components/student/answer')
  }
]

const router = createRouter({
  history: createWebHistory(), // 使用 HTML5 History 模式
  routes
})

export default router
